<?php

namespace App\Admin\Metrics\Examples;


use App\Models\User;
use Dcat\Admin\Widgets\Metrics\Card;

class TotalRegister extends Card
{

    public function init()
    {
        parent::init();
        $this->title('总注册');
        $total = User::query()->count();
        $this->withContent($total);
    }

    protected function withContent(int $total)
    {
        return $this->content(
            <<<HTML
<div class="d-flex justify-content-between align-content-center mt-1" style="margin-bottom: 2px">
    <h2 class="ml-1 font-lg-1">$total</h2>
</div>
HTML

        );

    }
}
